//
//  YWResetPasswordCell.m
//  maintain
//
//  Created by Kyo on 15/11/2.
//  Copyright © 2015年 ewin. All rights reserved.
//

#import "YWResetPasswordCell.h"
#import "YWMacro.h"

@interface YWResetPasswordCell()
@property (weak, nonatomic) UILabel *titleLabel;

@end
@implementation YWResetPasswordCell

+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString *identifier = @"YWResetPasswordCellIdentifier";
    YWResetPasswordCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
    if (cell == nil) {
        cell = [[YWResetPasswordCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return cell;
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initView];
    }
    return self;
}
//系统默认的cell的textLabel的x是15y是12 高度是20.5
-(void)initView{
    UILabel *titleL = [[UILabel alloc]initWithFrame:CGRectMake(15, 12, 68, 20.5)];
    titleL.font = KTitleFont;
    [self addSubview:titleL];
    self.titleLabel = titleL;
    
    UITextField *contentT = [[UITextField alloc]initWithFrame:CGRectMake(CGRectGetMaxX(titleL.frame)+15, 12, SCREEN_WIDTH-CGRectGetMaxX(titleL.frame)-15*2, 20.5)];
    contentT.font = KTitleFont;
    [contentT setSecureTextEntry:YES];
    contentT.keyboardType = UIKeyboardTypeASCIICapable;
    contentT.clearButtonMode = UITextFieldViewModeWhileEditing;
    [self addSubview:contentT];
    self.passwordTF = contentT;
}

-(void)setTitle:(NSString *)title{
    _title = title;
    self.titleLabel.text = title;
}

-(void)setPlaceHolder:(NSString *)placeHolder{
    self.passwordTF.placeholder = placeHolder;
}
@end
